<script>
/*
<template>
  <div class="xtx-bread">
    <slot />
  </div>
</template>
*/
import { h } from 'vue'
export default {
  name: 'XtxBread',
  render () {
    //   h('div',)
    // 获得插槽的内容函数，this.$slots.defaults
    // console.log(this.$slots.default())
    const tempArr = []
    this.$slots.default().forEach((item, index, arr) => {
      //   console.log(item)
      tempArr.push(item)

      if (index < arr.length - 1) {
        tempArr.push(h('i', { class: 'iconfont icon-angle-right' }))
      }
    })
    return h('div', { class: 'xtx-bread ' }, tempArr)
  }
}
</script>

<style lang="less">
.xtx-bread {
  display: flex;
  padding: 25px 10px;
  &-item {
    a {
      color: #666;
      transition: all 0.4s;
      &:hover {
        color: @xtxColor;
      }
    }
  }
  i {
    font-size: 12px;
    margin-left: 5px;
    margin-right: 5px;
    line-height: 22px;
  }
}
</style>
